<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Minim : : AudioPlayer : : getMetaData</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body> 
<center>
<table class="mainTable">

  <tr>
    <td class="header">
    	<span class="indexheader">Minim</span><br/>
    	<span class="indexnavigation">
    		<a href="index.html">core</a> | 
    		<a href="index_ugens.html">ugens</a> | 
    		<a href="index_analysis.html">analysis</a>
    	</span>
    </td>
    <td class="border-left">&nbsp;</td>
  </tr>
  
  <tr>
    <td class="classNavigation">
    	<p class="mainTextName"><A href="audioplayer_class_audioplayer.html">AudioPlayer</A></p>
    	<p class="methodName">getMetaData</p>
    </td>
    <td class="mainText border-left">
    	<p class="memberSectionHeader">Description</p>
    	Returns the meta data for the recording being played by this player.
    	
    	<p class="memberSectionHeader">Signature</p>
    	<pre>AudioMetaData getMetaData()
</pre>
    	
    	
    	
   <p class="memberSectionHeader">Returns</p> 
   <p>AudioMetaData: the meta data for this player's recording</p>
   
    	
    	<p class="memberSectionHeader">Related</p>
    	<A href="audioplayer_class_audioplayer.html">AudioPlayer</A><BR>
<A href="audiometadata_class_audiometadata.html">AudioMetaData</A><BR>

    	
    	<p class="memberSectionHeader">Example</p>
    	<pre>/**
 * Get Meta Data
 * by Damien Di Fede.
 *  
 * This sketch demonstrates how to use the &lt;code>getMetaData&lt;/code> 
 * method of &lt;code>AudioPlayer&lt;/code>. This method is also available 
 * for &lt;code>AudioSnippet&lt;/code> and &lt;code>AudioSample&lt;/code>. 
 * You should use this method when you want to retrieve metadata 
 * about a file that you have loaded, like ID3 tags from an mp3 file. 
 * If you load WAV file or other non-tagged file, most of the metadata 
 * will be empty, but you will still have information like the filename 
 * and the length.
 * &lt;p>
 * For more information about Minim and additional features, 
 * visit http://code.compartmental.net/minim/ 
 */

import ddf.minim.*;

Minim minim;
AudioPlayer groove;
AudioMetaData meta;

void setup()
{
  size(512, 256, P2D);
  
  minim = new Minim(this);
  groove = minim.loadFile("groove.mp3");
  meta = groove.getMetaData();
  
  textFont(createFont("Serif", 12));
}

int ys = 25;
int yi = 15;

void draw()
{
  background(0);
  int y = ys;
  text("File Name: " + meta.fileName(), 5, y);
  text("Length (in milliseconds): " + meta.length(), 5, y+=yi);
  text("Title: " + meta.title(), 5, y+=yi);
  text("Author: " + meta.author(), 5, y+=yi); 
  text("Album: " + meta.album(), 5, y+=yi);
  text("Date: " + meta.date(), 5, y+=yi);
  text("Comment: " + meta.comment(), 5, y+=yi);
  text("Lyrics: " + meta.lyrics(), 5, y+=yi ); 
  text("Track: " + meta.track(), 5, y+=yi);
  text("Genre: " + meta.genre(), 5, y+=yi);
  text("Copyright: " + meta.copyright(), 5, y+=yi);
  text("Disc: " + meta.disc(), 5, y+=yi);
  text("Composer: " + meta.composer(), 5, y+=yi);
  text("Orchestra: " + meta.orchestra(), 5, y+=yi);
  text("Publisher: " + meta.publisher(), 5, y+=yi);
  text("Encoded: " + meta.encoded(), 5, y+=yi);
}
</pre>
    	
    	<p class="memberSectionHeader">Usage</p>
    	Web & Application
    </td>
  </tr>
</table>
</center>
</body>
</html>
